package com.nisco.nio.buffer;

import java.nio.ByteBuffer;
import java.nio.CharBuffer;

public class ByteBufferTest {
    public static void main(String[] args) {
        ByteBuffer buffer = ByteBuffer.allocateDirect(10);
        buffer.put(new byte[] {0, 98, 0, 99, 0, 100, 0, 101, 0, 102});

        buffer.rewind();

        CharBuffer charBuffer = buffer.asCharBuffer();
        while (charBuffer.hasRemaining())
        {
            System.out.println(charBuffer.get());
        }
// b c d e f
    }
}
